import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 导入全局样式表
import './assets/css/global.css'
import './plugins/element.js'
import axios from 'axios'
// axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/' // 定义根路径
axios.defaults.baseURL = 'http://10.0.0.170:8020/api/v1/' // 定义根路径
// axios请求拦截
axios.interceptors.request.use(config => {
  // 为请求头对象，添加Token验证的Authorization字段
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
Vue.prototype.$http = axios // 在原型链上给$http赋值为axios对象

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
